#!/bin/sh
#desc:System logger


# Copyright(c) 2011 OpenDomo Services SL. Licensed under GPL v3 or later

PIDFILE="/var/run/syslogd.pid"
start() {
	touch /var/log/messages
	chmod g+r /var/log/messages
	echo -n "Starting SYSLOG ..."
	/sbin/syslogd -l 6 2>/dev/null
	#/sbin/klogd -c 2 2>/dev/null
	exit 0
}
stop(){
	echo -n "Stopping syslog ..."
	killall /sbin/syslogd 2>/dev/null 
	#killall /sbin/klogd 2>/dev/null
}
restart() {
	stop
	start
}
case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  reload)

  	if test -f "$PIDFILE"; then
	  	kill -HUP `cat $PIDFILE` 
	else
		restart
	fi
  	;;
  restart)
  	restart
	;;
  *)
	echo "Usage: $0 {start|stop|restart|reload}"
	exit 1
esac
